
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

typedef struct{
    unsigned long time;
    int status;  //0:pause 1:running 2:stop
    unsigned long offset;
    clock_t oldtime;
}Timer;



Timer * Timer_new();
void Timer_start(Timer *timer);
void Timer_stop(Timer *timer);
void Timer_pause(Timer *timer);
void Timer_resume(Timer *timer);
unsigned long Timer_get(Timer *timer);
void Timer_reset(Timer *timer,long count);
char *Timer_status(Timer *timer);
void Timer_term(Timer *timer);